package com.book.dao;

import com.book.pojo.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BookDao {

    int insertSelective(Book record);

    Book selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Book record);

    List<Book> getUBookList();

    Book getUBookByCode(String ubCode);

    String getUBCode(Integer parseInt);

    List<Book> getBookThree();

    List<Book> getBookListByUId(Integer currentId);

    List<Book> queryBookByKey(@Param("code") Integer queryCode, @Param("text") String queryText);

    List<Book> queryBook(@Param("key1") String title,@Param("key2") String author);

    List<Book> queryBookByCate(@Param("cateList") List<Integer> cateIdList, @Param("queryText") String queryText);

    List<Book> queryFilterCateList(@Param("cateList") List<Integer> cateIdList, @Param("p1") Double p1, @Param("p2") Double p2);

    List<Book> queryBookByCatePrice(@Param("cateId") Integer cateId,@Param("p1") Double p1, @Param("p2") Double p2);

    List<Book> getBookListByBookCode(@Param("codeList") List<String> codeList);

    Integer deleteBookById(Integer id);

    void deleteBookByIdList(@Param("ids") List<Integer> ids);
}